<?php

namespace IDock\Insurance\TPIC\Request;

use Exception;
use IDock\Insurance\TPIC\Request\AllTPICRequest;
use IDock\Insurance\TPIC\Response\AddNonCarOrderResponse;
use IDock\Insurance\TPIC\Response\OfferOrderPriceResponse;
use IDock\Insurance\TPIC\Response\SaveVehicleResponse;
use IDock\Insurance\TPIC\Response\VehicleModelResponse;
use IDock\Insurance\TPIC\TPICEnums;
use IDock\Visitor\NonCar\NonCarInquiryVisitor;
use IDock\Visitor\NonCar\NonCarProductVisitor;
use IDock\Visitor\Premium\PremiumChargingPileVisitor;
use IDock\Visitor\Premium\PremiumCoverageVisitor;
use IDock\Visitor\Premium\PremiumInquiryVisitor;
use IDock\Visitor\Premium\PremiumUnderwritingVisitor;
use IDock\Visitor\VehicleModelVisitor;

/**
 * 询价
 */
class AddNonCarOrderRequest extends AllTPICRequest
{
    protected $response = AddNonCarOrderResponse::class;

    protected $urlTip = '添加非车产品';

    public $route = 'operateFcOrder';

    /**
     * @var NonCarInquiryVisitor $visitor
     */
    protected $visitor;

    public function generate(): array
    {
        /*** @var NonCarProductVisitor $nonCarPrinter */
        $nonCarPrinter = $this->visitor->getNonCarList()[0] ?? [];
        $arr = [
            'fcOrder' => [
                'orderNo' => $this->visitor->argc['orderNo'] ?? '',
                'riskcode' => $nonCarPrinter->argc['riskcode'] ?? '',
                'action' => 'add',
                'productCode' => $nonCarPrinter->productCode,
                'productName' => $nonCarPrinter->argc['productName'] ?? '',
                'projectCode' => $nonCarPrinter->planCode,
                'quantity' => $nonCarPrinter->insuredNum,
                'premium' => $nonCarPrinter->premium,
                'insuredType' => '3',
            ]
        ];

        return $arr;
    }


}
